package cn.wanda.bi.sunshine.platform.server.client;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by wangfupeng1
 */
@FeignClient(name = "authWechat", url = "${client.auth.wechat.url:}")
public interface WechatAuthClient {

    @RequestMapping(method = {RequestMethod.GET}, value = {"/cgi-bin/ticket/getticket"})
    String jsapiTicket(@RequestParam("access_token") String access_token,
                        @RequestParam("type") String type);
    
    @RequestMapping(method = {RequestMethod.GET}, value = {"/cgi-bin/token"})
    String accessToken(@RequestParam("grant_type") String grant_type,
                        @RequestParam("appid") String appid,
                        @RequestParam("secret") String secret
                        );
    
    @RequestMapping(method = {RequestMethod.GET}, value = {"/sns/jscode2session"})
    String openId(@RequestParam("appid") String appid,
                        @RequestParam("secret") String secret,
                        @RequestParam("js_code") String js_code,
                        @RequestParam("grant_type") String grant_type
                        );
    
    @RequestMapping(method = {RequestMethod.GET}, value = {"/cgi-bin/user/info"})
    String userInfo(@RequestParam("access_token") String access_token,
                        @RequestParam("openid") String openid,
                        @RequestParam("lang") String lang
                        );
    
}
